<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>

    <title>蚂蚁摄影租赁后台管理系统</title>
    <!-- 设置浏览器标签页图标 -->
    <link rel="icon" th:href="@{/img/aa32.ico}" type="image/x-icon" />
    <link rel="shortcut icon" th:href="@{/img/aa32.ico}" type="image/x-icon" />
    <link rel="bookmark" th:href="@{/img/aa32.ico}" type="image/x-icon" />

    <link th:href="@{/css/bootstrap.min14ed.css}" href="" rel="stylesheet"/>
    <link th:href="@{/css/font-awesome.min93e3.css}" rel="stylesheet"/>
    <link th:href="@{/css/animate.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/style.min862f.css}" rel="stylesheet"/>
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>if(window.top !== window.self){ window.top.location = window.location;}</script>
    <link rel="bookmark" th:href="@{/img/mayi.ico}" type="image/x-icon" />
    <script th:src="@{/js/jquery.min.js}"></script>
    <script th:src="@{/js/bootstrap.min.js}"></script>
</head>
<body class="gray-bg">

<div class="middle-box text-center loginscreen animated fadeInDown" id="body">
    <div>
        <div style="text-align: center;">
            <!-- <h1 class="logo-name" style="font-size: 150px;margin: 0px;padding: 0px">MaE</h1> -->
            <img style="width:100%;height:50%;margin: 0px;padding: 0px;margin-top: 100px" th:src="@{/img/mylogo372.png}">
        </div>
        <h3 style="margin-top: 50px">蚂蚁摄影租赁后台管理系统</h3>

        <form class="m-t" id="userLogin" role="form" action="">
            <div class="form-group">
                <input type="email" id="tel" class="form-control" placeholder="用户名" required="">
            </div>
            <div class="form-group">
                <input type="password" id ="pwd" class="form-control" placeholder="密码" required="">
            </div>
            <button type="button" class="btn 0 block full-width m-b" style="background-color: #ea5550;color: white" onclick="login()">登 录</button>
        </form>

    </div>
    <div class="div1"></div>
</div>

<script type="text/javascript">
    $(function () {
        $("#tel").focus();
    })
    $("#body").bind("keydown",function(e){
        // 兼容FF和IE和Opera
        var theEvent = e || window.event;
        var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
        if (code == 13) {
            //回车执行查询
            login();
        }
    });
    function login(){
        var tel = $("#tel").val();
        var pwd = $("#pwd").val();
        if(tel===''){
            alert("请输入账号");
            return
        }
        if(pwd===''){
            alert("请输入密码");
            return
        }
        if(tel!=''&&pwd!=''){
            var param = {};
            param.tel=$("#tel").val();
            param.pwd=$("#pwd").val()
            $.ajax({url:"/login",type:"post",data:param,success:function(result){
                if(result["code"]===1){
                    $("#pwd").val("");
                    alert(result["msg"])
                }else if(result["code"]===0){
                    window.location = "/main";
                }
            }});
        }else{
            alert("账号密码不能为空！");
        }
    }

</script>
</body>
</html>